//
//  ContentCell.m
//  Finder
//
//  Created by cdm on 11-3-20.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import "ContentCell.h"


@implementation ContentCell

@synthesize titleLabel;
@synthesize leftIconImageView;
@synthesize rightIconImageView;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)dealloc
{
    [self.titleLabel release];
    [self.leftIconImageView release];
    [self.rightIconImageView release];    
    [super dealloc];
}

- (void) setGrouped:(BOOL)isGrouped
{
    if (isGrouped) {
        CGRect iconImageViewFrame = self.rightIconImageView.frame;
        iconImageViewFrame.origin.x = 265.0f;
        self.rightIconImageView.frame = iconImageViewFrame;
    } else {
        CGRect iconImageViewFrame = self.rightIconImageView.frame;
        iconImageViewFrame.origin.x = 285.0f;
        self.rightIconImageView.frame = iconImageViewFrame;
    }
}

- (void)showLeftIcon:(BOOL)isShow
{
    if (isShow) {
        self.leftIconImageView.hidden = NO;
        CGRect titleLabelFrame = self.titleLabel.frame;
        titleLabelFrame.origin.x = 50.0f;
        self.titleLabel.frame = titleLabelFrame;
    } else {
        self.leftIconImageView.hidden = YES;
        CGRect titleLabelFrame = self.titleLabel.frame;
        titleLabelFrame.origin.x = 10.0f;
        self.titleLabel.frame = titleLabelFrame;
    }
}

@end
